<cfif isdefined("session.DODAAC") or isdefined("form.DODAAC") or isdefined("url.DODAAC")>

<CFQUERY NAME="getprofile" DATASOURCE="#dsn#">
select *
from tblprofiles
where <cfif isdefined("session.DODAAC")>DODAAC = #session.DODAAC#<cfelse>DODAAC = #DODAAC#</cfif>
</CFQUERY>

<cfoutput><CFIF ISDEFINED("FORM.DODAAC")>
<CFSET SESSION.DODAAC = "#FORM.DODAAC#">
</CFIF>

<CFIF ISDEFINED("URL.DODAAC")>
<CFSET SESSION.DODAAC = "#url.DODAAC#">
</CFIF>


<CFQUERY NAME="getcomm" DATASOURCE="#Datasource#">
select *
from tblpayments
where pin = #DODAAC#
order by ReceiptNum
</CFQUERY>



</cfoutput>

<cfelse>

<CFQUERY NAME="getprofile" DATASOURCE="#dsn#">
select *
from tblprofiles
where DODAAC = 0
</CFQUERY>
<cflock timeout=20 scope="Session" type="Exclusive">
<cfset structdelete(SESSION, "DODAAC")> 
</cflock> 

<CFQUERY NAME="getcomm" DATASOURCE="#dsn#">
select *
from tblorders
where DODAAC = 0
order by ReceiptNum
</CFQUERY>

</cfif>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body,td,th {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 14px;
	color: #FFFFFF;
}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #1b3b63;
}
.style1 {
	font-size: 18px;
	font-weight: bold;
}
.style2 {
	font-size: 18px;
	font-weight: bold;
	color:#666666;
}
-->
</style>
<script src="../../../SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
<link href="../../../SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style3 {
	font-size: 12px;
	font-weight: bold;
}
.style4 {font-size: 12px}
.style6 {font-size: 12px; color: #666666; }
.style7 {color: #666666}
-->
</style>
</head>

<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><span class="style1">CUSTOMER INFORMATION
    </span>
      <HR size="1" noshade="noshade" /></td>
  </tr>
  <tr>
    <td height="232" valign="top"><cfoutput><table width="100%" border="0" cellspacing="1" cellpadding="4">
      <tr>
        <td colspan="3" align="left"><div id="TabbedPanels1" class="TabbedPanels">
          <ul class="TabbedPanelsTabGroup">
            <li class="TabbedPanelsTab" tabindex="0">Profile</li>
            <li class="TabbedPanelsTab" tabindex="0">Address</li>
            <li class="TabbedPanelsTab" tabindex="0">Contact Information</li>
            <li class="TabbedPanelsTab" tabindex="0">Payment History</li>
          </ul>
          <div class="TabbedPanelsContentGroup">
            <div class="TabbedPanelsContent"> <br />
             <cfform action="save.cfm" name="form1" method="post"> <table width="100%" border="0" cellspacing="0" cellpadding="3">
                <tr>
                  <td height="45" colspan="2"><p>Company Name:<br />
                    <label>
                      <cfinput type="text" name="companyname" class="style2" value="#getprofile.companyname#"><CFIF ISDEFINED("URL.NEW")><cfinput name="new" type="hidden" value="Yes" /></CFIF><cfinput name="tab" type="hidden" value="1" /><cfinput name="DODAAC" type="hidden" value="#getprofile.DODAAC#" />
                    </label>
                  </p>                    </td>
                  </tr>
                <tr>
                  <td width="50%" height="45">First Name:<br />
                    <label>
                    <cfinput type="text" name="FirstName" class="style2" value="#getprofile.FirstName#">
                    </label></td>
                  <td width="50%" height="45">Last Name:<br />
                    <label>
                    <cfinput type="text" name="LastName" class="style2" value="#getprofile.LastName#">
                    </label></td>
                  </tr>
                <tr>
                  <td height="45">Username:<br />
                    <label>
                    <cfinput type="text" name="Username" class="style2" value="#getprofile.Username#">
                    </label></td>
                  <td height="45">Password:<br />
                    <label>
                    <cfinput type="text" name="password" class="style2" value="#getprofile.Password#">
                    </label></td>
                  </tr>
                <tr>
                  <td height="45"><cfinput name="button2" type="submit" class="style2" id="button2" value="Save" /></td>
                  <td height="45">&nbsp;</td>
                </tr>
              </table></cfform>
            </div>
            <div class="TabbedPanelsContent"> <br />
             <cfform action="save.cfm" name="form1" method="post"> <table width="100%" border="0" cellspacing="0" cellpadding="3">
                <cfinput name="tab" type="hidden" value="2" /><cfinput name="DODAAC" type="hidden" value="#getprofile.DODAAC#" />
                <tr>
                  <td width="50%" height="45">Street Address:<br />
                      <label>
                      <cfinput type="text" name="Address" class="style2" value="#getprofile.Address#">
                      
                      </label></td>
                  <td width="50%" height="45">City:<br />
                      <label>
                      <cfinput type="text" name="City" class="style2" value="#getprofile.City#">
                    </label></td>
                </tr>
                <tr>
                  <td height="45">State:<br />
                      <label>
                      <cfinput type="text" name="State" class="style2" value="#getprofile.State#">
                    </label></td>
                  <td height="45">Zip Code:<br />
                      <label>
                      <cfinput type="text" name="ZipCode" class="style2" value="#getprofile.ZipCode#">
                    </label></td>
                </tr>
                <tr>
                  <td height="45"><label>
                    <input name="button" type="submit" class="style2" id="button" value="Save" />
                  </label></td>
                  <td height="45">&nbsp;</td>
                </tr>
              </table></cfform>
            </div>
            <div class="TabbedPanelsContent"> <cfform action="save.cfm" name="form1" method="post"> <table width="100%" border="0" cellspacing="0" cellpadding="3">
                <cfinput name="tab" type="hidden" value="3" /><cfinput name="DODAAC" type="hidden" value="#getprofile.DODAAC#" />
                <tr>
                  <td width="50%" height="45">Phone:<br />
                      <label>
                      <cfinput type="text" name="MainPhone" class="style2" value="#getprofile.MainPhone#" mask="999-999-9999">
                      </label></td>
                  <td width="50%" height="45">Fax:<br />
                      <label>
                      <cfinput type="text" name="fax" class="style2" value="#getprofile.fax#" mask="999-999-9999">
                    </label></td>
                </tr>
                <tr>
                  <td height="45">Cell:<br />
                      <label>
                      <cfinput type="text" name="cell" class="style2" value="#getprofile.cell#" mask="999-999-9999">
                    </label></td>
                  <td height="45">Email:<br />
                      <label>
                      <cfinput type="text" name="email" class="style2" value="#getprofile.email#" validate="email">
                    </label></td>
                </tr>
                <tr>
                  <td height="45"><label>
                    <input name="button" type="submit" class="style2" id="button" value="Save" />
                  </label></td>
                  <td height="45">&nbsp;</td>
                </tr>
              </table>
            </cfform></div>
            <div class="TabbedPanelsContent"><table width="100%" border="0" cellspacing="2" cellpadding="2">
  <tr>
    <td width="9%" align="center"><span class="style3">Receipt Num</span></td>
    <td width="9%"><span class="style3">Trans Date</span></td>
    <td width="12%"><span class="style3">Trans Time</span></td>
    <td width="16%"><span class="style3">Pay Type</span></td>
    <td width="8%"><span class="style3">Trans Type</span></td>
    <td width="12%"><span class="style3">Amount</span></td>
    <td width="6%" align="center" class="message style4">View Receipt</td>
    </tr>
  <cfloop query="getcomm">
  <CFQUERY NAME="getSUM" DATASOURCE="#dsn#">
select sum(Amount) as total
from tblpayments
where ReceiptNum = #ReceiptNum#
</CFQUERY><tr bgcolor="###iif(currentrow MOD 2,DE('e2e5e7'),DE('f1f8fc'))#" style="text-transform:uppercase;">
    <td align="center"><span class="style6">#ReceiptNum#</span></td>
    <!---need to change---> <td><span class="style7">#dateformat(TransDate, "mm/dd/yyyy")#</span></td>
    <td><span class="style7">#ReportTime#</span></td>
    <td><span class="style7">#PaymentType#</span></td>
    <td><span class="style7">#TransType#</span></td>
    <td><span class="style7">#lscurrencyformat(getSUM.total)#</span></td>
    <td align="center"><a href="javascript:()" onClick="javascript:window.open('PreviewOrder.cfm?ReceiptNum=#ReceiptNum#', 'Orders', 'Toolbar=no, width=700, height=600, scrollbars=yes');"><img src="images/edit2.gif" border="0"></a></td>
    </tr></cfloop>
</table>
            </div>
          </div>
        </div></td>
        </tr>
      
    </table>
    </cfoutput></td>
  </tr>
</table>
<cfif isdefined("url.tab")>
<cfset tab="#url.tab#"> 
<cfswitch expression="#tab#"> 
    <cfcase value="1"> 
      <script type="text/javascript">
<!--
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1", {defaultTab:1});
//-->
</script>
    </cfcase> 
    <cfcase value="2"> 
        <script type="text/javascript">
<!--
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1", {defaultTab:2});
//-->
</script>
    </cfcase> 
    <cfcase value="3"> 
        <script type="text/javascript">
<!--
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1", {defaultTab:3});
//-->
</script>
    </cfcase> 
    <cfcase value="4"> 
        <script type="text/javascript">
<!--
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1", {defaultTab:4});
//-->
</script> 
    </cfcase> 
    <cfdefaultcase> 
      <script type="text/javascript">
<!--
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1")
//-->
</script>
    </cfdefaultcase> 
</cfswitch>

<cfelse>

<script type="text/javascript">
<!--
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1")
//-->
</script>

</cfif>
<!---<cfif isdefined("url.tab0")>
<script type="text/javascript">
<!--
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1")
//-->
</script>
</cfif>

<cfif isdefined("url.tab0")>
<script type="text/javascript">
<!--
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1", {defaultTab:2});
//-->
</script>
</cfif>--->
</body>
</html>
